FROM golang:alpine

WORKDIR /go/src/gin-vue-admin
COPY . .
RUN go env -w GO111MODULE=on
RUN export GOPROXY=https://goproxy.io/
RUN go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
RUN export GOSUMDB=off
RUN go generate -mod=mod && go env && go build -mod=mod -o server .

FROM alpine:latest
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"

WORKDIR /go/src/gin-vue-admin

COPY --from=0 /go/src/gin-vue-admin ./

EXPOSE 8888

ENTRYPOINT ./server -c config.docker.yaml
